<?php
use yii\helpers\Url;
?>
添加员工

角色名称：<input id="departName" type="text" value="" placeholder="请填写角色名称">
备注：<input id="remark" type="text" value="" placeholder="请填写备注">
<input type="button" value="新增角色" onclick="addDepartment()">
<script>
    function addRole(){
        var params={};
        params.parentId=$('#upperDepart').val();
        params.departName=$('#departName').val();
        var url='<?=Url::toRoute(['system/add-roled'])?>';
        $.post(url,params,function(data){
            var data=JSON.parse($data);
            if(data.errcode==0){
                alert(data.errmsg);
                window.location.reload();
            }else{
                alert(data.errmsg);
            }
        });
    }
</script>